cmake_minimum_required(VERSION 2.4.6)

project(LIBLPA)

include_directories (${LIBLPA_SOURCE_DIR}/src)
link_directories (${LIBLPA_BINARY_DIR}/bin)
SET(EXECUTABLE_OUTPUT_PATH ${LIBLPA_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${LIBLPA_BINARY_DIR}/bin)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} -msse4.2 -O3 -fomit-frame-pointer -mstackrealign")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -msse4.2 -O3 -fomit-frame-pointer -mstackrealign")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS} -msse4.2 -s")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -msse4.2")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -msse4.2")

add_library (lpa SHARED src/liblpa.h src/liblpa.c)
add_executable (tests src/tests.c)
target_link_libraries (tests lpa)